home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / lseek.man < prev    next >
Encoding:
Text File  |  1989-01-28  |  2.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. LSEEK                 C Library Procedures                  LSEEK
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      lseek - move read/write pointer
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ffiillee..hh>>
  13.  
  14.      ##ddeeffiinnee LL__SSEETT   00 //** sseett tthhee sseeeekk ppooiinntteerr **//
  15.      ##ddeeffiinnee LL__IINNCCRR  11 //** iinnccrreemmeenntt tthhee sseeeekk ppooiinntteerr **//
  16.      ##ddeeffiinnee LL__XXTTNNDD  22 //** eexxtteenndd tthhee ffiillee ssiizzee **//
  17.  
  18.      ppooss == llsseeeekk((dd,, ooffffsseett,, wwhheennccee))
  19.      ooffff__tt ppooss;;
  20.      iinntt dd;;
  21.      ooffff__tt ooffffsseett;;
  22.      iinntt wwhheennccee;;
  23.  
  24. DDEESSCCRRIIPPTTIIOONN
  25.      The descriptor _d refers to a file or device open for reading
  26.      and/or writing.  _L_s_e_e_k sets the file pointer of _d as fol-
  27.      lows:
  28.  
  29.           If _w_h_e_n_c_e is L_SET, the pointer is set to _o_f_f_s_e_t bytes.
  30.  
  31.           If _w_h_e_n_c_e is L_INCR, the pointer is set to its current
  32.           location plus _o_f_f_s_e_t.
  33.  
  34.           If _w_h_e_n_c_e is L_XTND, the pointer is set to the size of
  35.           the file plus _o_f_f_s_e_t.
  36.  
  37.      Upon successful completion, the resulting pointer location
  38.      as measured in bytes from beginning of the file is returned.
  39.      Some devices are incapable of seeking.  The value of the
  40.      pointer associated with such a device is undefined.
  41.  
  42. NNOOTTEESS
  43.      Seeking far beyond the end of a file, then writing, creates
  44.      a gap or "hole", which occupies no physical space and reads
  45.      as zeros.
  46.  
  47. RREETTUURRNN VVAALLUUEE
  48.      Upon successful completion, the current file pointer value
  49.      is returned.  Otherwise, a value of -1 is returned and _e_r_r_n_o
  50.      is set to indicate the error.
  51.  
  52. EERRRROORRSS
  53.      _L_s_e_e_k will fail and the file pointer will remain unchanged
  54.      if:
  55.  
  56.      [EBADF]        _F_i_l_d_e_s is not an open file descriptor.
  57.  
  58.      [ESPIPE]       _F_i_l_d_e_s is associated with a pipe or a socket.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0             February 24, 1986                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LSEEK                 C Library Procedures                  LSEEK
  71.  
  72.  
  73.  
  74.      [EINVAL]       _W_h_e_n_c_e is not a proper value.
  75.  
  76. SSEEEE AALLSSOO
  77.      dup(2), open(2)
  78.  
  79. BBUUGGSS
  80.      This document's use of _w_h_e_n_c_e is incorrect English, but
  81.      maintained for historical reasons.
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0             February 24, 1986                       2
  130.  
  131.  
  132.  
  133.